﻿<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->

<common:LayoutAwarePage
    x:Class="Tiles.EnableNotificationQueue"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Tiles"
    xmlns:common="using:SDKTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid x:Name="Input" Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold">
                    This scenario demonstrates how to queue more than one notification and control which notifications are replaced as new notifications arrive.
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" Margin="0,20,0,0"  TextWrapping="Wrap" FontWeight="Bold">
                    Notification Queue
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" >
                    If this setting is enabled, Windows will queue up to five notifications and automatically cycle the tile content between them.
                    Notifications will be saved in a FIFO (first in, first out) queue according to arrival time.
                    The display order and animation time for notifications cannot be controlled by applications.
                    If a new notification is received, it will always be the first to display when the tile next animates.
                    <LineBreak/>
                    If the user is offline, up to five push notifications will be saved and delivered when the user comes online.
                    These undelivered notifications also conform to the FIFO queue described above and tag logic described below.
                </TextBlock>

                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,20,0,0" FontWeight="SemiBold">
                    Enable/Disable needs to be called only once in the lifetime of your app:
                </TextBlock>
                <StackPanel Orientation="Horizontal" >
                    <Button x:Name="EnableQueue" Content="Enable notification queue" Click="EnableNotificationQueue_Click"/>
                    <Button x:Name="DisableQueue" Content="Disable notification queue" Click="DisableNotificationQueue_Click"/>
                </StackPanel>

                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,20,0,0" FontWeight="SemiBold" TextWrapping="Wrap">
                    Enable/Disable by tile size:
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" TextWrapping="Wrap">
                    Instead of a single call for all tile sizes, you can also selectively enable/disable notifications queue per tile size.
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,20,0,0" FontWeight="SemiBold" TextWrapping="Wrap">
                    Enable/Disable for Square150x150 tile size only:
                </TextBlock>
                <StackPanel Orientation="Horizontal" >
                    <Button x:Name="EnableSquare150x150NotificationQueue" Content="Enable notification queue for Square150x150 tiles" Click="EnableSquare150x150NotificationQueue_Click"/>
                    <Button x:Name="DisableSquare150x150NotificationQueue" Content="Disable notification queue for Square150x150 tiles" Click="DisableSquare150x150NotificationQueue_Click"/>
                </StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,10,0,0" FontWeight="SemiBold" TextWrapping="Wrap">
                    Enable/Disable for Wide310x150 tile size only:
                </TextBlock>
                <StackPanel Orientation="Horizontal" >
                    <Button x:Name="EnableWide310x150NotificationQueue" Content="Enable notification queue for Wide310x150 tiles" Click="EnableWide310x150NotificationQueue_Click"/>
                    <Button x:Name="DisableWide310x150NotificationQueue" Content="Disable notification queue for Wide310x150 tiles" Click="DisableWide310x150NotificationQueue_Click"/>
                </StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,10,0,0" FontWeight="SemiBold" TextWrapping="Wrap">
                    Enable/Disable for Square310x310 tile size only:
                </TextBlock>
                <StackPanel Orientation="Horizontal" >
                    <Button x:Name="EnableSquare310x310NotificationQueue" Content="Enable notification queue for Square310x310 tiles" Click="EnableSquare310x310NotificationQueue_Click"/>
                    <Button x:Name="DisableSquare310x310NotificationQueue" Content="Disable notification queue for Square310x310 tiles" Click="DisableSquare310x310NotificationQueue_Click"/>
                </StackPanel>

                <TextBlock Style="{StaticResource BasicTextStyle}" Margin="0,30,0,0"  TextWrapping="Wrap" Text="Tags" FontWeight="Bold"/>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text="Tags (application specified strings) can be used to replace notifications. If the notification queue is enabled, untagged notifications will queue in FIFO order. A tagged notification will replace a queued notification with the same tag. There can only be one notification with the same tag in the queue at a time. Tags which are sent from the cloud are limited to the alpha-numeric character set." />
                <StackPanel Orientation="Vertical" >
                    <TextBlock Style="{StaticResource BasicTextStyle}" Margin="0,20,0,0" TextWrapping="Wrap" FontWeight="SemiBold">
                        Send a Tag:
                    </TextBlock>

                    <TextBlock Style="{StaticResource BasicTextStyle}">Maximum of 16 characters, the default value is 'TestTag01'.</TextBlock>
                    <StackPanel Orientation="Horizontal" >
                        <TextBox x:Name="Id" Text="" Margin="0,0,0,0" Width="200"/>
                    </StackPanel>

                    <TextBlock Style="{StaticResource BasicTextStyle}" Margin="0,10,0,0" TextWrapping="Wrap" FontWeight="SemiBold">
                         Enter the text to be sent to the tile:
                    </TextBlock>
                    <StackPanel Orientation="Horizontal" >
                        <TextBox x:Name="TextContent" Text="" Margin="0,0,0,0" Width="200"/>
                    </StackPanel>
                </StackPanel>

                <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
                    <Button x:Name="UpdateTile" Content="Send tile notification with a tag" Click="UpdateTile_Click"/>
                    <Button x:Name="ClearTile" Content="Clear tile" Click="ClearTile_Click"/>
                </StackPanel>
            </StackPanel>
        </Grid>

        <Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
            <TextBlock x:Name="OutputTextBlock" Text="" TextWrapping="Wrap"  Style="{StaticResource BasicTextStyle}" IsTextSelectionEnabled="True"/>
        </Grid>

        <!-- Add Storyboards to the visual states below as necessary for supporting the various layouts -->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="DefaultLayout"/>
                <VisualState x:Name="Below768Layout"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>

</common:LayoutAwarePage>